#include "common.h"

int main()
{
    key_t key = ftok(PATH_NAME,PROJ_ID);
    if(key < 0)
    {
        perror("ftok");
        return 1;
    }
    int shmid = shmget(key,4096,IPC_CREAT | IPC_EXCL);
    if(shmid < 0)
    {
        perror("shmget");
        return 2;
    }
    printf("key:%d  shmid:%d\n",key,shmid);
    sleep(10);
    shmctl(shmid,IPC_RMID,NULL);
    printf("key : 0x%x shmid: %d -> shm delete success\n",key,shmid);
    return 0;
}